﻿<Window x:Class="Update.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Properties="clr-namespace:Update.Properties"
        Title="HTC Home Update" Width="600" Height="400" WindowStartupLocation="CenterScreen" Background="Transparent"
        SourceInitialized="WindowSourceInitialized">
    <Window.Resources>
        <LinearGradientBrush x:Key="TabControlBgBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#fbfcfd" Offset="0"/>
            <GradientStop Color="#e0e3e7" Offset="1"/>
        </LinearGradientBrush>
    </Window.Resources>
    <DockPanel Name="Root" Background="{StaticResource TabControlBgBrush}">
        <Grid DockPanel.Dock="Bottom">
            <Rectangle Fill="#c1c2c3" VerticalAlignment="Top" Height="1" Margin="0,0,0,0"/>
            <Rectangle VerticalAlignment="Top" Height="4" Margin="0,1,0,0">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="#AAc6c9cd" Offset="0"/>
                        <GradientStop Color="#e3e7ec" Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,10">
                <Button Name="InstallButton" Height="23" Content="{x:Static Properties:Resources.Install}" Margin="0,0,7,0" Padding="15,0,15,0" HorizontalAlignment="Right" Click="InstallButtonClick"/>
                <Button Name="CloseButton" Height="23" Content="{x:Static Properties:Resources.Close}" Margin="0,0,7,0" Padding="15,0,15,0" HorizontalAlignment="Right" Click="CloseButtonClick"/>
            </StackPanel>

        </Grid>
        <Grid Background="White">
            <Rectangle Height="3" VerticalAlignment="Top" Margin="0,0,0,0">
                <Rectangle.OpacityMask>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                        <GradientStop Color="#00000000" Offset="0"/>
                        <GradientStop Color="#FF000000" Offset="0.1"/>
                        <GradientStop Color="#FF000000" Offset="0.9"/>
                        <GradientStop Color="#00000000" Offset="1.0"/>
                    </LinearGradientBrush>
                </Rectangle.OpacityMask>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="#22000000" Offset="0"/>
                        <GradientStop Color="#00000000" Offset="1.0"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <DockPanel Margin="10,10,0,0">
                <StackPanel Name="HeaderPanel" DockPanel.Dock="Top">
                    <TextBlock Name="HeaderTextBlock" Text="{x:Static Properties:Resources.UpdatesAvailable}" FontSize="24" FontWeight="Light" Foreground="#083ca2"/>
                    <Separator Margin="0,0,0,0" VerticalAlignment="Top"/>
                    <ProgressBar Name="ProgressBar" Height="18" Margin="0,5,0,5" Background="#11000000" IsIndeterminate="True" Visibility="Collapsed"/>
                    <TextBlock Name="RestartText" Text="{x:Static Properties:Resources.Restart}" Foreground="Gray" TextWrapping="Wrap" Visibility="Collapsed"/>
                    <Button Name="RestartButton" Content="{x:Static Properties:Resources.RestartButton}" HorizontalAlignment="Left" Padding="10,2,10,2" Margin="0,5,0,0" Click="RestartButtonClick" Visibility="Collapsed"/>
                </StackPanel>
                <Grid Name="DetailsGrid" DockPanel.Dock="Right" Width="200">
                    <Rectangle Fill="{StaticResource TabControlBgBrush}" Opacity="1"/>
                    <Rectangle Width="1" Fill="Black" Opacity="0.2" HorizontalAlignment="Left"/>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{Binding ElementName=UpdatesList, Path=SelectedItem.Title}" Margin="5" FontWeight="Bold" TextWrapping="Wrap"/>
                        <TextBlock Text="{Binding ElementName=UpdatesList, Path=SelectedItem.Description}" Margin="5,0,5,5" TextWrapping="Wrap"/>
                    </StackPanel>
                </Grid>
                <ListView Name="UpdatesList" Background="Transparent" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                            HorizontalContentAlignment="Stretch">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Header="{x:Static Properties:Resources.Name}" DisplayMemberBinding="{Binding Title}"/>
                            <GridViewColumn Header="{x:Static Properties:Resources.Size}" DisplayMemberBinding="{Binding Size}"/>
                        </GridView>
                    </ListView.View>
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Vertical">
                                <TextBlock DockPanel.Dock="Left" FontFamily="Segoe UI" FontSize="14" Text="{Binding Title, Mode=OneTime}" VerticalAlignment="Center" ToolTip="{Binding Title, Mode=OneTime}"/>
                                <TextBlock Text="{Binding Size, Mode=OneTime}" TextWrapping="Wrap" FontFamily="Segoe UI" FontSize="12" Margin="0,0,0,0" Foreground="Gray"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
            </DockPanel>
        </Grid>
    </DockPanel>
</Window>
